package org.colcon.web.client.ui.deprecated;

import org.colcon.web.client.Collective_Congress;
import org.colcon.web.model.framework.IPower;
import org.colcon.web.model.framework.ITitle;

import com.google.gwt.user.client.ui.HorizontalPanel;

public class TitleInfoPanel extends InfoPanel 
{
	public TitleInfoPanel(Collective_Congress client, ITitle title) 
	{
		super(client, title);
		
		//add(new NamePanel(client, title.getGroup()));
		
		for(IPower power : title.getPowers())
			add(new PowerNamePanel(getClient(), title.getPath(), power.getId()));
	}
	
	public HorizontalPanel getHeader()
	{
		HorizontalPanel header = new HorizontalPanel();
		header.setWidth("100%");
		NamePanel title = new NamePanel(getClient(), getItem().getPath());
		title.setStyleName("info-title");
		header.add(title);
		
		NamePanel groupName = new NamePanel(getClient(), ((ITitle)getItem()).getGroup());
		groupName.setStyleName("info-group");
		header.add(groupName);
		
		return header;
	}
}